home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
u_man
/
cat1
/
size.z
/
size
Wrap
Text File
|
1998-10-30
|
10KB
|
265 lines
SSSSIIIIZZZZEEEE((((1111)))) SSSSIIIIZZZZEEEE((((1111))))
NNNNAAAAMMMMEEEE
size - print the section sizes of object files
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
ssssiiiizzzzeeee [ ----dddd ----ffff ----nnnn ----oooo ----4444 ----ssssvvvvrrrr4444 ----xxxx ----AAAA ----BBBB ----FFFF ----VVVV ] files
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
The _s_i_z_e command prints segment or section information in bytes about the
various sections or segments of each named ELF object _f_i_l_e. Each _f_i_l_e
can be an object or an archive.
When calculating segment information, the _s_i_z_e command prints out the
total file size of the non-writable segments, the total file size of the
writable segments, and the total memory size minus the total file size of
the writable segments.
If it cannot find segment information, _s_i_z_e calculates based on section
information. When calculating based on section information, it
calculates the total size of sections that are allocatable, non-writable
and not NOBITS; the total size of the sections that are allocatable,
writable, and not NOBITS; and the total size of the writable sections of
type NOBITS (NOBITS sections do not actually take up space in the _f_i_l_e.)
Among the sections which may be mentioned and counted are: ._t_e_x_t, ._i_n_i_t,
._r_d_a_t_a, ._d_a_t_a, ._s_d_a_t_a, ._s_b_s_s, ._d_y_n_s_y_m, ._d_s_o_l_i_s_t, ._c_o_n_f_l_i_c_t, and ._l_c_l_d_t_a.
Some of the sections marked allocatable, for example ._s_t_r_t_a_b and ._s_y_m_t_a_b
may be a surprise, since they don't seem as if they would be loaded at
run time. However, some of this information does get into symbol tables
which, for shared-code (PIC) are in memory at run time so _r_l_d(1) can use
them.
By default, the output format is that of AT&T System V Release 3 showing
sections (not segments) as described above followed by System V Release
4-style totals.
_s_i_z_e supports the following options:
----dddd Print the sizes in decimal.
----ffff Prints out the size of each allocatable section, the name of the
section, and the total of the section sizes. If there is no section
data, _s_i_z_e prints out an error message and stops processing the
file. Segment information is ignored: only section information is
used.
----nnnn Prints out non-loadable segment or non-allocatable section sizes.
If segment data exists, _s_i_z_e prints out the memory size of each
loadable segment or file size of each non-loadable segment, the
permission flags, and the total size of the segments. If there is
no segment data, _s_i_z_e prints out, for each allocatable and non-
allocatable section, the memory size, the section name, and the
total size of the sections. If there is no segment or section data,
_s_i_z_e prints an error message and stops processing.
PPPPaaaaggggeeee 1111
SSSSIIIIZZZZEEEE((((1111)))) SSSSIIIIZZZZEEEE((((1111))))
----oooo Print the sizes in octal.
----4444 Suppress detailed listings, leaving just the AT&T System V Release 4
summary output. If segment information is present, print it rather
than section information (unless ----ffff is also present).
----ssssvvvvrrrr4444
The same as -4, but deprecated as multi-letter options are not
appropriate under System V Release 4 option guidelines.
----xxxx Print the sizes in hexadecimal.
----AAAA Use AT&T System V Release 3-style output. This is the default
style. This style is more verbose than the ----4444 output; each section
is printed with both size and physical and virtual addresses. It is
followed by the System V Release 4-style totals. Segment
information is ignored: only section information is used.
----BBBB Use Berkeley-style (4.3BSD) output. This style prints size
information for each section, regardless of whether the file exists,
and prints the total in both hexadecimal and decimal. The _t_e_x_t and
_d_a_t_a section sizes reported may be rounded to page sizes. In the
rounding (done by _l_d(1)) some _b_s_s may be moved into _d_a_t_a. The
numbers reported are the actual numbers used to load the program
into memory. Only sections named ._t_e_x_t, ._i_n_i_t or ._f_i_n_i are counted
as text. Segment information is ignored: only section information
is used.
----FFFF Prints out the size of each loadable segment, the permission flags
of the segment, then the total of the loadable segment sizes. If
there is no segment data, _s_i_z_e prints an error and stops processing
the file.
----VVVV Print the version of _s_i_z_e on standard error.
EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
The examples below show typical _s_i_z_e output.
size -4 _f_i_l_e
90112 + 12288 + 0 = 102400
size -svr4 -f _f_i_l_e
_1_9(._i_n_t_e_r_p) + _2_4(._r_e_g_i_n_f_o) + _1_9_2(._d_y_n_a_m_i_c) + _3_2(._l_i_b_l_i_s_t) + _1_2_0_0(._m_s_y_m)
+ _1_6_0_0(._d_y_n_s_t_r) + _2_3_8_4(._d_y_n_s_y_m) + _1_6_3_2(._h_a_s_h) + _8_2_5_6_0(._t_e_x_t) + _3_2(._i_n_i_t)
+ _1_4_7_2(._d_a_t_a) + _8_0_0_0(._r_o_d_a_t_a) + _4_6_4(._g_o_t) + _4_8(._b_s_s) = _9_9_6_5_9
PPPPaaaaggggeeee 2222
SSSSIIIIZZZZEEEE((((1111)))) SSSSIIIIZZZZEEEE((((1111))))
size -4 -F _f_i_l_e
_9_0_1_1_2(_r-_x) + _1_2_2_8_8(_r_w-) = _1_0_9_4_8_3
SSSSEEEEEEEE AAAALLLLSSSSOOOO
a.out (4)
System V Application Binary Interface
Pub by Prentice Hall,
ISBN 0-13-877598-2
System V Application Binary Interface MIPS
Processor Supplement
Pub by Prentice Hall,
ISBN 0-13-880170-3
MIPSpro Assembly Language Programmer's Guide
/usr/include/elf.h
/usr/include/sys/elf.h
DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
_s_i_z_e cannot calculate either segment or section information, it prints an
error message and stops processing the file.
NNNNOOOOTTTTEEEESSSS
Since the size of ._b_s_s sections is not known until link-time, _s_i_z_e will
not give the true total size of pre-linked objects.
The rounding shown by the ----BBBB option can have effects that may surprise:
reducing the size of data a small amount can result in some _b_s_s space
being moved from the rounded _d_a_t_a back into _b_s_s and make _b_s_s appear to
grow.
Some sections are shown and counted as data with the ----BBBB option that might
be considered text in some sense. For example, the ....rrrrooooddddaaaattttaaaa section is
counted as data even if it is part of the shared text program header
segment.
The ----BBBB option interacts strangely with other options such as ----nnnn aaaannnndddd ----ffff
making the output useless.
The last of ----ssssvvvvrrrr4444, ----4444,,,, ----AAAA, and ----BBBB is the option applied if more than one
is supplied.
For executables, arguably size -4 a.out is more accurate than size -B
a.out since the former reports totals of precisely what the kernel must
load (using segment information) whereas the latter reports how the
sections describe the a.out but counting only the text as text, not
counting ._d_y_n_s_y_m etc. On the other hand, the ----BBBB format does directly
describe the executable instructions (leaving out read-only tables) so
for some purposes it may be more useful.
Section names given above are mostly described in the Application Binary
Interface books mentioned in the SEE ALSO section above. In addition,
some sections are described in the MIPSpro Assembly Language Programmers
PPPPaaaaggggeeee 3333
SSSSIIIIZZZZEEEE((((1111)))) SSSSIIIIZZZZEEEE((((1111))))
Guide (mentioned above).
PPPPaaaaggggeeee 4444